package com.sinaapp.mrblog.game.Assasin;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.sinaapp.mrblog.game.Assasin.screen.ChooseScreen;
import com.sinaapp.mrblog.game.Assasin.screen.GameScreen;
import com.sinaapp.mrblog.game.Assasin.screen.StartScreen;
import com.sinaapp.mrblog.game.Assasin.util.AssasinConst;

public class Assasin extends Game {
	public static final int ASSASIN_STATE_GAME = 1;
	public static final int ASSASIN_STATE_CHOOSE =2;
	public static final int ASSASIN_STATE_START = 3;
	
	public static int state;
	public static ChooseScreen chooseScreen;
	public static GameScreen gameScreen;
	public static StartScreen startScreen;
	
	
	public static OrthographicCamera CAMERA;
	public float statetime = 0f;
	public static Assasin assasin;
	
	
	@Override
	public void create() {		
		CAMERA = new OrthographicCamera();
		CAMERA.setToOrtho(false,AssasinConst.GAMESTAGE_WIDTH, AssasinConst.GAMESTAGE_HEIGHT);
		state = ASSASIN_STATE_START;
		assasin = this;
	}

	@Override
	public void dispose() {
		
	}

	@Override
	public void render() {	
		switch (state) {
		case ASSASIN_STATE_CHOOSE:
			if(chooseScreen==null) chooseScreen = new ChooseScreen();
			if(!(getScreen() instanceof ChooseScreen)) setScreen(chooseScreen);
			break;
		case ASSASIN_STATE_GAME:
			if(gameScreen == null) gameScreen = new GameScreen();
			if(!(getScreen() instanceof ChooseScreen)) setScreen(gameScreen);
		case ASSASIN_STATE_START:
			if(startScreen == null) startScreen = new StartScreen();
			if((!(getScreen() instanceof StartScreen))) setScreen(startScreen);
		default:
			break;
		}
		Gdx.gl.glClearColor(1, 1, 1, 1);
		Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);
		super.render();
	}

	@Override
	public void resize(int width, int height) {
	}

	@Override
	public void pause() {
	}

	@Override
	public void resume() {
	}
}
